package com.dy.design_pattern_study.prototype_mode.dome2;

import lombok.Data;

import java.io.Serializable;

/**
 * @CreateBy zhangdingyi
 * @Date 2023-03-23
 * @Content 城市类
 */
@Data
public class City implements Serializable,Cloneable {
    private String cityName;
    private String cityAddress;

    /**
     * 对引用对象也创建克隆方法 --已达到深克隆的目的
     * @return
     * @throws CloneNotSupportedException
     */
    public Object Clone() throws CloneNotSupportedException {
        return (Object) this.clone();
    }
}
